All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.sound.SPB

java.lang.Object
   |
   +----quicktime.util.QTByteObject
           |
           +----quicktime.sound.SPB

public final class SPB
extends QTByteObject
implements QuickTimeLib
The SPB class is used in conjunction with a SPBDevice to record sound. It contains fields that describe how much sound the device should record and a buffer of memory where the recorded sound is recorded.


Variable Index

 o kNativeSize
This is the size (the number of bytes) that are required for this class

Constructor Index

 o SPB(SPBDevice, int, int, QTPointerRef)
Create a SPB.

Method Index

 o getBuffer()
Sets the buffer that the device will record into.
 o getBufferLength()
Get the number of bytes that are or were recorded.
 o getCount()
Get the number of bytes that are or were recorded.
 o getDevice()
Gets the device that is attached to this object.
 o getError()
You can call this to check the value of the error code.
 o getMilliseconds()
Get the the number of milliseconds that are or were recorded.
 o isRecording()
The status of the recording.
 o meterLevel()
The level of the meter.
 o pauseRecording()
Pause recording from a sound input device.
 o record(boolean)
Record audio data into memory, either synchronously or asynchronously.
 o resumeRecording()
Pause recording from a sound input device.
 o setBuffer(QTPointerRef)
Sets the buffer that the device will record into.
 o setCount(int)
Sets the number of bytes that are to be recorded.
 o setMilliseconds(int)
Sets the the number of milliseconds that are to be recorded.
 o stopRecording()
End a recording from a sound input device.

Variables

 o kNativeSize
 public static final int kNativeSize
This is the size (the number of bytes) that are required for this class

Constructors

 o SPB
 public SPB(SPBDevice device,
            int count,
            int milliseconds,
            QTPointerRef buffer)
Create a SPB.

Parameters:
device - the SPBDevice that is to be used for recording the sound
count - how many bytes of data to record
milliseconds - On input, the number of milliseconds to record. If this field indicates a longer recording time than the count field, then the count field is ignored.
buffer - A QTPointer to the buffer for the sampled-sound data. If this buffer length is too small to contain the amount of sampled-sound data specified in the count and milliseconds fields, then recording time is truncated so that the sampled-sound data fits in the buffer.

Methods

 o getCount
 public int getCount()
Get the number of bytes that are or were recorded.

Returns:
number of bytes
 o setCount
 public void setCount(int count)
Sets the number of bytes that are to be recorded.

Parameters:
count - number of bytes
 o getBufferLength
 public int getBufferLength()
Get the number of bytes that are or were recorded.

Returns:
number of bytes
 o getMilliseconds
 public int getMilliseconds()
Get the the number of milliseconds that are or were recorded.

Returns:
number of milliseconds
 o setMilliseconds
 public void setMilliseconds(int msecs)
Sets the the number of milliseconds that are to be recorded.

Parameters:
msecs - milliseconds
 o getDevice
 public SPBDevice getDevice()
Gets the device that is attached to this object.

Returns:
the SPBDevice
 o setBuffer
 public void setBuffer(QTPointerRef buffer)
Sets the buffer that the device will record into.

Parameters:
buffer - the record buffer
 o getBuffer
 public QTPointerRef getBuffer()
Sets the buffer that the device will record into.

Parameters:
buffer - the record buffer
 o getError
 public short getError()
You can call this to check the value of the error code. An error code > 0 means that an Async recording is still occuring. An error code == 0 means no recording and no error. An error code < 0 means that an error has occured and recording is terminated.

 o record
 public void record(boolean flag) throws SoundException
Record audio data into memory, either synchronously or asynchronously. The sound is recorded into the specified buffer. If it is recorded synchronously then the error code will be checked and an exception thrown if required. If recorded asynchronously then the application will need to check for errors after the recording has completed with the checkError code. After recording the buffer contains the recorded bytes, the count how many bytes were recorded, the milliseconds how many milliseconds of sound were recorded based on the current settings of the device.

QuickTime::SPBRecord

Parameters:
flag - if true record asynchronously, if false records synchronously.
 o pauseRecording
 public void pauseRecording() throws SoundException
Pause recording from a sound input device.

QuickTime::SPBPauseRecording

 o resumeRecording
 public void resumeRecording() throws SoundException
Pause recording from a sound input device.

QuickTime::SPBResumeRecording

 o stopRecording
 public void stopRecording() throws SoundException
End a recording from a sound input device. If you call the checkError instance method you will get an abortErr exception which indicates that the recording was stopped by calling this method.

QuickTime::SPBStopRecording

 o isRecording
 public boolean isRecording() throws SoundException
The status of the recording. While the input device is recording, this call returns true. When a recording terminates without an error, this call false. When an error occurs during recording or the recording has been terminated by a call to the SPBStopRecording function (abortErr), this call throws an exception.

QuickTime::SPBGetRecordingStatus

 o meterLevel
 public short meterLevel() throws SoundException
The level of the meter. While the input device is recording, this call returns the level.

QuickTime::SPBGetRecordingStatus


All Packages  Class Hierarchy  This Package  Previous  Next  Index